import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home"
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login.vue"),
    meta: { title: "系统首页" }
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("../views/Home.vue"),
    meta: { title: "系统首页" },
    children: [
      {
        path: "/",
        redirect: "/index"
      },
      {
        path: "/index",
        name: "Index",
        meta: { title: "系统首页" },
        component: () => import("../views/index.vue")
      },
      {
        path: "/productList",
        name: "ProductList",
        meta: { title: "商品管理" },
        component: () => import("../views/ProductList.vue")
      },
      {
        path: "/Distribution",
        name: "Distribution",
        meta: { title: "配货出库" },
        component: () => import("../views/Distribution.vue")
      },
      {
        path: "/supplier",
        name: "supplier",
        meta: { title: "供应商基础设置" },
        component: () => import("../views/supplier.vue")
      },
      {
        path: "/userManage",
        name: "UserManage",
        meta: { title: "员工管理" },
        component: () => import("../views/UserManage.vue")
      },
      {
        path: "/groupManage",
        name: "GroupManage",
        meta: { title: "分组管理" },
        component: () => import("../views/GroupManage.vue")
      },
      {
        path: "/branchStore",
        name: "branchStore",
        meta: { title: "选择总部" },
        component: () => import("../views/branchStore.vue")
      },
      {
        path: "/branchStore2",
        name: "branchStore2",
        meta: { title: "总部信息设置" },
        component: () => import("../views/branchStore2.vue")
      },
      {
        path: "/branchStore3",
        name: "branchStore3",
        meta: { title: "分店信息设置" },
        component: () => import("../views/branchStore3.vue")
      },
      {
        path: "/branchStore4",
        name: "branchStore4",
        meta: { title: "柜台信息设置" },
        component: () => import("../views/branchStore4.vue")
      },
      {
        path: "/permissions",
        name: "Permissions",
        meta: { title: "角色管理" },
        component: () => import("../views/Permissions.vue")
      },
      {
        path: "/modelManage",
        name: "ModelManage",
        meta: { title: "模块管理" },
        component: () => import("../views/ModelManage.vue")
      },
      {
        path: "/chailiao",
        name: "Chailiao",
        meta: { title: "商品拆料" },
        component: () => import("../views/chailiao.vue")
      },
      {
        path: "/shiliao1",
        name: "shiliao1",
        meta: { title: "石料基础设置" },
        component: () => import("../views/shiliao1")
      },
      {
        path: "/jiben",
        name: "jiben",
        meta: { title: "石料基础设置" },
        component: () => import("../views/jiben")
      },
      {
        path: "/table",
        name: "table",
        meta: { title: "石料基础设置" },
        component: () => import("../views/table")
      },
      {
        path: "/pifa",
        name: "pifa",
        meta: { title: "石料基础设置" },
        component: () => import("../views/pifa")
      },
      {
        path: "/commodity",
        name: "Commodity",
        meta: { title: "原厂商品退货" },
        component: () => import("../views/Commodity.vue")
      }
    ]
  }
];

const router = new VueRouter({
  mode: "history",
  routes
});

export default router;
